var JieElement = function(){
//	alert("JieElement");
	this.element = null;
	this.iWidth = 0;
	this.iHeight = 0;
	this.bgColor = "";//标题栏背景色
	this.foreColor = "";//标题栏文字颜色
	this.fontFamily = "";//标题栏字体
	this.fontSize = "";//字体大小
	this.align = "";
	this.borderStyle = "";
	this.borderColor = "";
	this.oldDisplay = "";
	/**
	 * 根据使用标签名创建dom节点，并指定节点的宽高
	 * @param {Object} asTagName[必填] 字符串类型标签名。如果为空或者不是字符串类型，系统将抛出异常。
	 * @param {Object} aiWidth[选填] 节点宽度
	 * @param {Object} aiHeight[选填] 节点高度 
	 * 
	 * @return element 返回节点对象
	 */
	this.makeElement = function(asTagName, aWidth, aHeight){
		
		if(asTagName === null || typeof(asTagName)!== "string") throw new Error(sGmsg["ELE_001"]);
		
		this.element = document.createElement(asTagName);
		//alert("makeElement");
		if(aWidth !=null) this.setWidth(aWidth);
		if(aHeight !=null) this.setHeight(aHeight);
		
//		this.oldCss = window.getComputedStyle?window.getComputedStyle(this.element,null):this.element.currentStyle;
//		alert(this.oldCss.display);
		return this.element;
	};
};
JieElement.prototype = {
	/**
	 * 获取节点的数字类型节点宽度
	 * 
	 * @return width 节点宽度
	 */
	getWidth : function(){
		return this.iWidth+"px";
	},
	/**
	 * 设置节点的宽度
	 * @param {Object} aWidth 可使用数字类型或字符串类型数据设置节点宽度，如50、"50"、"50px"均可
	 */
	setWidth : function(aWidth){
	//alert("setWidth:"+Util.getLengthNumber(aWidth));
		this.iWidth = Util.getLengthNumber(aWidth);
		this.element.style.width = this.iWidth+"px";		
	},
	/**
	 * 获取节点的数字类型节点高度
	 * 
	 * @return Height 节点高度
	 */
	getHeight : function(){
		return this.iHeight+"px";
	},
	/**
	 * 设置节点的高度
	 * @param {Object} aHeight 可使用数字类型或字符串类型数据设置节点高度，如50、"50"、"50px"均可
	 */
	setHeight : function(aHeight){
		//alert(Util.getLengthNumber);
		this.iHeight = Util.getLengthNumber(aHeight);
		this.element.style.height = this.iHeight+"px";
	},
	getElement : function(){
		return this.element;
	},
	
	setBgColor : function(asBgColor){
		if(asBgColor != null){
			this.bgColor = asBgColor;
			this.element.style.backgroundColor = this.bgColor;
		}
	},
	getBgColor : function(){
		return this.bgColor;
	},
	setForeColor : function(asForeColor){
		if(asForeColor != null){
			this.foreColor = asForeColor;
			this.element.style.color = this.foreColor;
		}
	},
	getForeColor : function(){
		return this.foreColor;
	},
	setFontFamily : function(asFontFamily){
		if(asFontFamily != null){
			this.fontFamily = asFontFamily;
			this.element.style.fontFamily = this.fontFamily;
		}
	},
	getFontFamily : function(){
		return this.fontFamily;
	},
	setFontSize : function(asFontSize){
		if(asFontSize != null){
			this.fontSize = Util.getLengthNumber(asFontSize);
			this.element.style.fontSize = this.fontSize+"px";
		}
	},
	getFontSize : function(){
		return this.fontSize+"px";
	},
	setAlign : function(asAlign){
		if(asAlign != null){
			this.align = asAlign;
			this.element.style.textAlign = this.align;
		}
	},
	getAlign : function(){
		return this.align;
	},
	setBorderStyle : function(asBorderStyle){
		if(asBorderStyle != null){
			this.borderStyle = asBorderStyle;
			this.element.style.borderStyle = this.borderStyle;
		}
	},
	getBorderStyle : function(){
		return this.borderStyle;
	},
	setBorderColor : function(asBorderColor){
		if(asBorderColor != null){
			this.borderColor = asBorderColor;
			this.element.style.borderColor = this.borderColor;
		}
	},
	getBorderColor : function(){
		return this.borderColor;
	},
	
	setDisplay : function(abDisplay){
		if(abDisplay){
			this.element.style.display = this.oldDisplay;
		}else{
			this.oldDisplay = ""+this.element.style.display;
			this.element.style.display = "none";
		}
	},
	setVisibility : function(abVisible){
//		visibility:visible
		if(abVisible){
			this.element.style.visibility = "visible";
		}else if(!abVisible){
			this.element.style.visibility = "hidden";
		}
	}
};
